Skip to content

chore: adds LDTransactionalFeatureStore, LDTransactionalDataSourceUpdates, and FDv2 DataSource impls. #833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

tanderson-ld
Copy link
Contributor

@tanderson-ld tanderson-ld commented Apr 25, 2025

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

This PR moves changes for FDv2 from the temporary holding branch to main. All picked code has been previously reviewed and was picked from the temporary holding branch using file pick commands.

Resolved conflicts with @abarker-launchdarkly's recent initMetadata changes. Please verify those conflict resolutions @abarker-launchdarkly .

@tanderson-ld tanderson-ld requested a review from a team as a code owner April 25, 2025 21:26
Copy link
Contributor

github-actions bot commented Apr 25, 2025

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Size: 23840 bytes
Size limit: 25000

Copy link
Contributor

github-actions bot commented Apr 25, 2025

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Size: 20702 bytes
Size limit: 21000

Copy link
Contributor

github-actions bot commented Apr 25, 2025

@launchdarkly/js-client-sdk-common size report
This is the brotli compressed size of the ESM build.
Size: 15786 bytes
Size limit: 20000

@tanderson-ld tanderson-ld force-pushed the ta/fdv2-code-move-part2 branch from 76369ec to eb45ed6 Compare April 28, 2025 15:16
* @param selector opaque string that uniquely identifies the state that contains the changes
* @param callback Will be called after the changes are applied.
*/
applyChanges(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change, which would require the SDKs be major versioned.

It is possible to do this as an optional method, but require that method to support FDv2.

This interface is both exported and expected to be implemented by external packages. So, for example, node server would need major versioned and then the persistence packages would need major versioned with that new version constraint.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, the persistent store implementations don't really need to implement this if it is handled at the wrapper.

So I would expect either two interfaces, or one interface with an optional method addition.

The two interfaces would allow for internal type safety, as types used with V2 would need to implement it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to have LDTransactionalFeatureStore and LDTransactionalDataSourceUpdates interfaces which contain the additional transactional method. Going to optimize the interface declaration to use Partial.

* @param initMetadata Optional metadata to initialize the data source with.
* @param selector opaque string that uniquely identifies the state that contains the changes
*/
applyChanges(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See note for store.

This interface is in the sub-systems folder, which means it could be implemented externally.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to have LDTransactionalFeatureStore and LDTransactionalDataSourceUpdates interfaces which contain the additional transactional method. Going to optimize the interface declaration to use Partial.

@tanderson-ld tanderson-ld changed the title chore: adds applyChanges to LDFeatureStore and impls. Adds TransactionalPersistentStore. chore: adds LDTransactionalFeatureStore and impls. May 7, 2025
@tanderson-ld tanderson-ld changed the title chore: adds LDTransactionalFeatureStore and impls. chore: adds LDTransactionalFeatureStore, LDTransactionalDataSourceUpdates, and FDv2 DataSource impls. May 7, 2025
@tanderson-ld tanderson-ld force-pushed the ta/fdv2-code-move-part2 branch from e3f5ac5 to b0d426c Compare May 7, 2025 16:01
@tanderson-ld tanderson-ld requested a review from kinyoklion May 7, 2025 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants